home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 128 24
/
q24.d81
/
t.mouse 80
< prev
next >
Wrap
Text File
|
2022-08-28
|
18KB
|
333 lines
M O U S E 8 0
by Maurice Randall
FENDER'S PREMUMBLE: The following is essentially the same instructions for
using MOUSE 80 that were published on LS 128 #15. I've removed the part
about the "mousemover" program which allowed you to assemble the MOUSE 80
object code where you want. If you don't want to use any of the three
versions of the object code that appear on this issue, then you'll need LS
128 #10 to make your own version. If you do use MouseMover from LS 128
#15 then here's a tip: After creating a version of MOUSE 80 at a location,
break out of the MouseMover program and re-run it. If you assemble
another version of MOUSE 80 without breaking out and re-running the
program, the second (and any subsequent) version won't work properly.
MOUSE 80 is a device driver for the Commodore 1351 mouse or
compatibles. It is designed to be used with the 128 in 80 column 'text
mode' only. This driver will fill a void that most people do not realize
existed. The 1351 mouse has been around for a while now, and there are
mouse drivers for it. The demo disk that comes with the mouse has an
assortment of drivers for the 64 mode and the 128 mode, but the 128 mode
driver is only for 40-column use. It makes use of a sprite for the
pointer that is visible on the screen. Sprites are not available on the
80-column screen. Sprites are easily simulated on the 128's 80-column
graphic screen, but then you are limited to creating 'graphic text'. GEOS
works this way, and GEOS is an excellent system, but there is still a need
for applications written to use the 128's native text mode.
What makes this driver different is the fact that it moves the
pointer about the text screen smoothly. There have been other mouse
drivers for the 80-column text screen, but these move the mouse pointer
around the screen a full character at a time. They work fine, but the
smoothness of movement isn't there. The only smooth mouse pointer I'm
aware of for the 128 is incorporated into the Pocket Series software from
Digital Solutions. But their mouse routines are not available to the
public. Therefore, I have designed MOUSE 80 so that other software
developers might make use of the 1351 mouse with a smooth moving pointer
in their programs. Any new development for the 128 should definitely make
use of the new hardware that is available, and MOUSE 80 will help give a
more professional appearance to the program.
MOUSE 80 can be used with a BASIC or ML program. It uses a jump
table to call its routines and you can also read or change various
variables that are used by MOUSE 80.
To use MOUSE 80, you would include the following statement in a BASIC
loader:
bload"mouse80.o"onu(dv) where dv is the current drive number
Once your main program begins, you can use the various jump addresses
and variables locations to initially install the mouse wedge into the IRQ
interrupt sequence, turn the mouse pointer on and off, or to find or set
the pointer on the screen. You can locate the pointer according to its
pixel location. You can also confine the mouse to a defined region or
'window'. You can tell if either button is being pressed. You can also
instruct MOUSE 80 to set up a jump address for the application to call if
one of the buttons is pressed.
If you don't like the looks of the mouse pointer, you can change its
appearance by altering the eight bytes that make up its picture.
There are four graphic characters from the upper/lower case set that
are used by MOUSE 80. If you need to use these characters, you can choose
any other four characters instead. It would be a very rare program that
would have to use each of the 512 characters that are available.
Whenever you are accessing the screen, you should 'hide' the mouse
pointer to prevent garbage from appearing on the screen. The 80-column
VDC chip is very touchy, and does not like the mouse when the screen is
scrolling, or if you are typing characters into the same location that the
mouse is occupying. So, just call 'HIDEMOUS' before any screen access and
call 'SHOWMOUS' when finished. When the mouse is hidden, the pointer is
not displayed, but movement is still possible. So, you could use this to
your advantage for various things such as menus. As the mouse is moved up
and down, you could highlight the menu item that is being pointed at, much
like what is usually done with the CRSR keys. If you call the routine,
'STOPMOUS', then the pointer is not only hidden, but its location also is
not updated. It will remain frozen in the spot it was in when the routine
was called. The buttons are still active so that you can still check for
either button being pressed. Either 'SHOWMOUS' or 'HIDEMOUS' will then
make the mouse active again. 'HIDEMOUS' will leave the pointer hidden.
The following is a list of available routines and variables along
with their locations in memory:
Name ML Basic Description
-------------------------------------------------------------------------
INSTALL JSR $1300 SYS 4864 Initially installs the mouse wedge
REMOVE JSR $1303 SYS 4867 Removes mouse wedge from thesystem.
HIDEMOUS JSR $1306 SYS 4870 Hides the pointer from view.
SHOWMOUS JSR $1309 SYS 4873 Displays the pointer on the screen.
STOPMOUS JSR $130C SYS 4876 Stops the mouse and hides it.
CKSTATUS JSR $130F SYS 4879 Check location of mouse on screen.
USERJUMP JSR $1312 SYS 4882 User callable according to buttons.
(Locations $1315-$1317 are not used. They are reserved for future use.)
There are a number of variables that may be read or set. Here is a
listing of those variables, their location offset in relation to the
starting address and a brief description.
The following bytes define the region in which to confine the mouse
pointer. The default settings are for the entire screen.
LTXLIMIT +24,25 Left border (lsb,msb) (0-319)
UPYLIMIT +26 Upper border (0-199)
RTXLIMIT +27,28 Right border (lsb,msb) (0-319)
LOYLIMIT +29 Lower border (0-199)
The following locations define the present location of the mouse. These
are best checked by machine language. When using BASIC, the mouse could
move between the time it takes to check the X position and the Y
position.
XCHAR +30 Column location of the mouse.
YCHAR +31 Row location of the mouse.
CXPOS +32,33 Horizontal pixel location of the mouse.
CYPOS +34 Vertical pixel location of the mouse
From BASIC, (or ML) you could check these locations after accessing the
routine called 'CKSTATUS' at $130F with a SYS 4879. The exact location of
the mouse when 'CKSTATUS' is accessed is saved here until the next time
the routine is accessed.
BXCHAR +35 Column location.
BYCHAR +36 Row location.
BCXPOS +37,38 Horizontal pixel location.
BCYPOS +39 Vertical pixel location.
These next two locations may be set in order to place the mouse pointer at
a specific location on the screen. 'SETXPOS' should be set to a two-byte
value ranging from 0-319, and 'SETYPOS' should be 0-199. Always POKE the
value into SETXPOS+1 last, because after MOUSE 80 checks these bytes, bit
7 of SETXPOS+1 will be set which makes MOUSE 80 ignore these values. If
you were to set this location before the other three (from BASIC), they
would most likely be read before you are done setting the other bytes and
so the mouse would not be placed in the desired location. From machine
language, it is not a problem since you can disable the interrupts first.
SETXPOS +40,41 Place pointer at this X location.
SETYPOS +42 Place pointer at this Y location.
LTBUTTON +43 Current status of left button.
RTBUTTON +44 Current status of right button.
LTCHECK +45 Latched status of left button.
RTCHECK